package com.github.m6d21.sso.support.model;

/**
 *<p>
 *Response
 *</p>
 *
 * @author liuyang
 * @date 2018-12-05 Wed 22:46:48
 * @since 1.0.0
 */
public class Response<T> {

    private Boolean success = false;
    private Integer code;
    private String msg;
    private T data;
    private String traceId;
    private Long timestamp;

    public Boolean isSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public Response<T> success(boolean success) {
        this.success = success;
        return this;
    }

    public Response<T> code(Integer code) {
        this.code = code;
        return this;
    }

    public Response<T> data(T data) {
        this.data = data;
        return this;
    }

    public Response<T> timestamp(Long timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    public Response<T> msg(String msg) {
        this.msg = msg;
        return this;
    }

    public Response<T> traceId(String traceId) {
        this.traceId = traceId;
        return this;
    }

    @Override
    public String toString() {
        return "Response{" +
            "success=" + success +
            ", code=" + code +
            ", msg='" + msg + '\'' +
            ", data=" + data +
            ", traceId='" + traceId + '\'' +
            '}';
    }

}
